<template>
  <div id="app">
  	<transition name="fade">  		
  		<router-view></router-view>
  	</transition>
  </div>
</template>

<script>
export default {
	created(){
//		console.log(this.$http);
	},
	mounted(){
		window.onbeforeunload = function(e){
			//因为remenber的值是以字符串的方式存储到localStorage中的,所以需要判断它是否是false还是true,这就需要用到三目运算来比较得出结果  
			var remember = localStorage.getItem('remember')=='false'?false:true;    
      if(!remember){
        localStorage.clear();
      }
		}
	}
}
</script>

<style lang="scss" scoped>
	.fade-enter-active,.fade-leave-active{
		transition: all 0.5s;
	}
	.fade-enter,.fade-leave-to{
		opacity: 0;
	}
	#app{
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background: white;
	}
</style>
